package pers.hl.common.ui.widget

import android.content.Context
import android.util.AttributeSet
import android.util.Log
import kotlin.math.abs

class ExVerticalRecyclerView @JvmOverloads constructor(
    context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
) : BaseNestedRecyclerView(context, attrs, defStyleAttr) {


    override fun needInterceptEvent(x: Float, y: Float): Boolean {
        val deltaX = abs(x - lastX)
        val deltaY = abs(y - lastY)
        Log.d("一次滑动", String.format("deltaX:%s, deltaX:%s", deltaX, deltaY))
        if (deltaX < deltaY) {
            return true
        }
        return false
    }
}